
//
//  SYS_MineBaseCell.m
//  System_App
//
//  Created by 伟徐 on 2017/11/28.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_MineBaseCell.h"

@implementation SYS_MineBaseCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self.contentView addSubview:self.logoImg];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.rightImg];
        [self.contentView addSubview:self.lineLabel];
    }
    return self;
}

- (void)layoutSubviews{
    [_logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(20);
        make.centerY.mas_equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(40, 40));
    }];

    [_titleLabel sizeToFit];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_logoImg.mas_right).offset(12);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    [_rightImg sizeToFit];
    [_rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-16);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(_rightImg.mas_left).offset(-12);
        make.centerY.mas_equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(SCREENWIDTH-154, 40));
    }];
    
    [_lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(0);
        make.top.equalTo(self.contentView).offset(64);
        make.size.mas_equalTo(CGSizeMake(SCREENWIDTH, 1));
    }];
    
}

-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont systemFontOfSize:17.f];
        _titleLabel.textColor = RGBACOLOR(6, 6, 6, 1);
    }
    return _titleLabel;
}


-(UILabel *)contentLabel{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = [UIFont systemFontOfSize:15.f];
        _contentLabel.textAlignment =NSTextAlignmentRight;
        _contentLabel.textColor = RGBACOLOR(130,131,131, 1);
    }
    return _contentLabel;
}

-(UIImageView *)logoImg{
    if(!_logoImg){
        _logoImg =[[UIImageView alloc] init];
        _logoImg.layer.cornerRadius = 20;
        _logoImg.layer.masksToBounds = YES;
    }
    return _logoImg;
}

-(UIImageView *)rightImg{
    if(!_rightImg){
        _rightImg =[[UIImageView alloc] init];
    }
    return _rightImg;
}

-(UILabel *)lineLabel{
    if (!_lineLabel) {
        _lineLabel = [[UILabel alloc] init];
        _lineLabel.backgroundColor = RGBACOLOR(240,240,240, 1);
    }
    return _lineLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
